<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            width:100px;
            height: 50px;
            background: url(../images/green.png) no-repeat;
            float: left;
            margin-right: 10px;
            text-align: center;
            line-height: 50px;
            color:white;
        }
    </style>
    <script>
        function doOver(obj){
            obj.style.backgroundImage="url(../images/blue.png)";
        }
        function doOut(obj){
            obj.style.backgroundImage="url(../images/green.png)";
        }
    </script>
</head>
<body>

    <!--mouseover鼠标悬浮在标签上-->
    <!--mouseout鼠标离开某元素-->
    <div onmouseover="doOver(this)" onmouseout="doOut(this)">南京</div>
    <div onmouseover="doOver(this)" onmouseout="doOut(this)">北京</div>
    <div onmouseover="doOver(this)" onmouseout="doOut(this)">天津</div>
</body>
</html>